/* GUI CONVERTED from rppqiq.p (converter v1.75) Sat Aug 12 23:11:38 2000 */
/* rppqiq.p - PRODUCT LINE RESOURCE REQUIREMENT INQUIRY                 */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* web convert rppqiq.p (converter v1.00) Fri Oct 10 13:57:59 1997 */
/* web tag in rppqiq.p (converter v1.00) Mon Oct 06 14:18:39 1997 */
/*F0PN*/ /*K1DH*/ /*                                                    */
/*V8:ConvertMode=Report                                        */
/* REVISION: 1.0      LAST MODIFIED: 04/22/86   BY: EMB */
/* REVISION: 4.0     LAST EDIT: 12/30/87    BY: WUG *A137* */
/* REVISION: 5.0     LAST EDIT: 05/03/89    BY: WUG *B098* */
/* Revision: 7.3    Last edit: 11/19/92     By: jcd *G339* */
/* Revision: 8.6    Last edit: 12/11/97     By: bvm *K1DH* */
/* REVISION: 9.1    LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00 BY: *N0KP* myb              */

/*K1DH*/ /* DISPLAY TITLE */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*K1DH*/ {mfdtitle.i "b+ "}

define variable rsc like pq_rsc.
define variable prod_line like pl_prod_line.
define variable site like pq_site.
define variable um like rs_um.

/*K1DH* /* DISPLAY TITLE */
 * {mfdtitle.i "b+ "} */

site = global_site.


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   prod_line
   site
   rsc
   with frame a no-underline width 80 attr-space THREE-D /*GUI*/.

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



   /* SET EXTERNAL LABELS */
   setFrameLabels(frame a:handle).

/*K1DH*/ {wbrp01.i}
repeat:

/*K1DH*/ if c-application-mode <> 'web' then
      update prod_line site rsc with frame a editing:

      if frame-field = "prod_line" then do with frame a:
     {mfnp.i pq_mstr prod_line pq_prod_line
        prod_line pq_prod_line pq_mstr}
     if recno <> ? then
     display pq_prod_line @ prod_line with frame a.
     recno = ?.
      end.
      else
      if frame-field = "site" then do with frame a:
     {mfnp.i si_mstr site si_site site si_site si_site}
     if recno <> ? then
     display si_site @ site.
     recno = ?.
      end.
      else
      if frame-field = "rsc" then do with frame a:
     {mfnp.i pq_mstr rsc pq_rsc rsc pq_rsc pq_rsc}
     if recno <> ? then
     display pq_rsc @ rsc.
     recno = ?.
      end.
      else do:
     readkey.
     apply lastkey.
      end.
   end.

/*K1DH*/ {wbrp06.i &command = update &fields = " prod_line site rsc" &frm = "a"}

/*K1DH*/ if (c-application-mode <> 'web') or
/*K1DH*/ (c-application-mode = 'web' and
/*K1DH*/ (c-web-request begins 'data')) then do:

   hide frame b.
   hide frame c.

/*K1DH*/ end.

   /* SELECT PRINTER */
   {mfselprt.i "terminal" 80}

   if prod_line > "" then
   for each pq_mstr no-lock use-index pq_mstr
   where pq_prod_line = prod_line
   and (pq_site = site or site = "")
   and (pq_rsc = rsc or rsc = "" )
   with frame b width 80 no-attr-space:
                /* SET EXTERNAL LABELS */
                setFrameLabels(frame b:handle).
                
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
         /*G339*/

      um = "".
      find rs_mstr where rs_rsc = pq_rsc
      and rs_site = pq_site
      no-lock no-error.
      if available rs_mstr then um = rs_um.

      display pq_prod_line pq_site pq_rsc pq_qty um pq_lead
      pq_lt_off pq_start pq_end WITH STREAM-IO /*GUI*/ .
   end.
   else for each pq_mstr no-lock use-index pq_mstr
   where (pq_site = site or site = "")
   and (pq_rsc = rsc or rsc = "" )
   with frame c width 80 no-attr-space:
                /* SET EXTERNAL LABELS */
                setFrameLabels(frame c:handle).
                
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
         /*G339*/

      um = "".
      find rs_mstr where rs_rsc = pq_rsc
      and rs_site = pq_site
      no-lock no-error.
      if available rs_mstr then um = rs_um.

      display pq_prod_line pq_site pq_rsc pq_qty um pq_lead
      pq_lt_off pq_start pq_end WITH STREAM-IO /*GUI*/ .
   end.
   {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

   {mfmsg.i 8 1}
end.

/*K1DH*/ {wbrp04.i &frame-spec = a}
